<!DOCTYPE HTML>
<html>

	<head>
		<title>尤洪商城后台登陆</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="keywords" content="Novus Admin Panel Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template, 
SmartPhone Compatible web template, free WebDesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design" />
		<script type="application/x-javascript">
			addEventListener("load", function() {
				setTimeout(hideURLbar, 0);
			}, false);

			function hideURLbar() {
				window.scrollTo(0, 1);
			}
		</script>
		<!-- Bootstrap Core CSS -->
		<link href="css/bootstrap.css" rel='stylesheet' type='text/css' />
		<!-- Custom CSS -->
		<link href="css/style.css" rel='stylesheet' type='text/css' />
		<!-- font CSS -->
		<!-- font-awesome icons -->
		<link href="css/font-awesome.css" rel="stylesheet">
		<!-- //font-awesome icons -->
		<!-- js-->
		<script src="js/jquery-1.11.1.min.js"></script>
		<script src="js/modernizr.custom.js"></script>
		<!--webfonts-->
		<link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&subset=all" rel="stylesheet" type="text/css">
  <link href="http://fonts.googleapis.com/css?family=PT+Sans+Narrow&subset=all" rel="stylesheet" type="text/css">
  <link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,900&subset=all" rel="stylesheet" type="text/css">
		<!--//webfonts-->
		<!--animate-->
		<link href="css/animate.css" rel="stylesheet" type="text/css" media="all">
		<script src="js/wow.min.js"></script>
		<script>
			new WOW().init();
		</script>
		<!--//end-animate-->
		<!-- Metis Menu -->
		<script src="js/metisMenu.min.js"></script>
		<script src="js/custom.js"></script>
		<script src="js/jquery.form.js"></script>
		<link href="css/custom.css" rel="stylesheet">
		<!--//Metis Menu -->
	</head>

	<body class="cbp-spmenu-push">
		<div class="main-content">
			<!-- main content start-->
			<div id="page-wrapper" style="margin: 0em 0 0 0em;padding: 1em 0em 0em ;">
				<div class="main-page login-page ">
					<h3 class="title1">尤洪商城后台登录</h3>
					<div class="widget-shadow">
						<div class="login-top">
							<h4>欢迎来到尤洪商城<br>还不是商家用户？<a href="register">申请成为吧 »</a> </h4>
						</div>
						<div class="login-body">
							<form id="loginForm" action="loginNow.do" method="post">
								<input type="text" class="user" name="loginName" placeholder="输入您的账号" th:each="cookie:${#httpServletRequest.getCookies()}" th:if="${cookie.getName() == 'backName'}" th:value="${cookie.getValue()}" required>
								<input type="password" name="pwd" class="lock" placeholder="密码" th:each="cookie:${#httpServletRequest.getCookies()}" th:if="${cookie.getName() == 'backPwd'}" th:value="${cookie.getValue()}" required>
								<input type="text" name="backUserVerifyCode" class="" style="width: 60%;" placeholder="验证码" required><img id="verifyimg" onclick="getvCode()" style="margin-left: 2%;"  />
								<input type="submit" name="Sign In" value="登录">
								<div class="forgot-grid">
									<label class="checkbox">
										<input type="checkbox" name="remPwd" checked="">
										<i></i>记住密码
									</label>
									<label class="checkbox" style="margin-left: 40px;">
										<input type="checkbox" name="isAdmin" >
										<i></i>是否是管理员
									</label>
									<div class="forgot">
										<a href="javascript:void(0)" data-toggle="modal" data-target="#exampleModal" data-whatever="@mdo">忘记密码</a>
									</div>
									<div class="clearfix"> </div>
								</div>
							</form>
						</div>
					</div>

					<div class="login-page-bottom">
						<h5> - OR -</h5>
						<div class="social-btn">
							<a href="#"><i class="fa fa-facebook"></i><i>Sign In with Facebook</i></a>
						</div>
						<div class="social-btn sb-two">
							<a href="#"><i class="fa fa-twitter"></i><i>Sign In with Twitter</i></a>
						</div>
					</div>
				</div>
			</div>
			<!--footer-->
			<div class="footer" style="padding: 0.5em;">
				<p>Copyright &copy; 2016.Company name All rights reserved.
					<a target="_blank" href="http://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a>
				</p>
			</div>
			<!--//footer-->
		</div>
		<!-- 重置密码框 -->
		<div class="col-md-4 modal-grids">
			<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
				<div class="modal-dialog" role="document">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" id="backResetPwdCloseButton" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
							<h4 class="modal-title" id="exampleModalLabel">重置密码</h4>
						</div>
						<form style="margin: auto" id="backResetPwdForm" action="backResetPwd.do" method="post">
							<div class="modal-body">
								
									<!-- <div class="form-group" style="margin-left: 20%;">
										<label for="recipient-name" class="control-label">用户名:</label>
										<input type="text" name="" class="form-control" id="recipient-name" style="display: inline;width: 50%">
									</div>
									<div class="form-group" style="margin-left: 20%;">
										<label for="recipient-name" class="control-label">邮箱验证码:</label>
										<input type="text" name="" class="form-control" id="recipient-name" style="display: inline;width: 50%">
									</div> -->
									<table style="margin-left: 20%;text-align: right;border-collapse:separate; border-spacing:0px 10px;" cellspacing="0" cellpadding="0">
										<tr>
											<td>
												<label for="recipient-name" class="control-label">用户名:</label>
											</td>
											<td>
												<input type="text" name="loginName" id="resetLoginName" placeholder="请输入登录用户名" class="form-control" style="display: inline;" required="required">
											</td>
											<td>&nbsp;</td>
										</tr>
										<tr>
											<td>
												<label for="recipient-name" class="control-label">是否为管理员:</label>
											</td>
											<td>
												<input type="checkbox" name="isAdmin" id="resetIsAdmin" class="form-control"  style="display: inline;">
											</td>
											<td>&nbsp;</td>
										</tr>
										<tr>
											<td>
												<label for="recipient-name" class="control-label">邮箱验证码:</label>
											</td>
											<td>
												<input type="text" name="backResetPwdEmail" id="backResetPwdEmail" placeholder="请输入邮箱验证码" class="form-control" style="display: inline;" checked=false required="required">
											</td>
											<td><button type="button" id="sendBackResetPWDEmailButton" class="btn btn-default" onclick="sendBackEmail(60000)" style="margin-left: 10px;">点击发送</button></td>
										</tr>
										<tr>
											<td>
												<label for="recipient-name" class="control-label">新密码:</label>
											</td>
											<td>
												<input type="password" name="resetPwd" id="resetPwd" placeholder="请输入6-15位密码" class="form-control" pattern="^.{6,15}$" style="display: inline;" required="required">
											</td>
											<td>&nbsp;</td>
										</tr>
										<tr>
											<td>
												<label for="recipient-name" class="control-label">确认密码:</label>
											</td>
											<td>
												<input type="password" name="resetruePwd" id="resetruePwd" placeholder="请重复输入密码" class="form-control" pattern="^.{6,15}$" style="display: inline;" required="required">
											</td>
											<td>&nbsp;</td>
										</tr>
									</table>
								
							</div>
							<div class="modal-footer">
								<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
								<button type="submit" class="btn btn-primary">重置密码</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
		<!-- //重置密码框 -->
		<!-- 消息提示框 -->
		<div class="col-md-4 modal-grids">
		<button type="button" id="asdf" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-sm" style="display: none;">Small modal</button>
			<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
				<div class="modal-dialog modal-sm">
					<div class="modal-content"> 
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
							<h4 class="modal-title" id="mySmallModalLabel">温馨提示</h4> 
						</div> 
						<div class="modal-body" id="tipContent"> Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.
						</div>
					</div>
				</div>
			</div>
		</div>
		<!-- //消息提示框 -->
		
		
		<script type="text/javascript">
			// 发送重置密码的邮件
			function sendBackEmail(time){
				var userName=$('#resetLoginName').val();
				var resetIsAdmin = $('#resetIsAdmin').is(':checked');
				if(userName == ''){
					$('#tipContent').html('请输入用户名');
                	$("#asdf").trigger('click');
					return;
				}
				
				$('#sendBackResetPWDEmailButton').attr('disabled','disabled');
			    setTimeout(function() {
			        var x = setInterval(function(){
			                time= time - 1000; //reduce each second
			                $('#sendBackResetPWDEmailButton').css('width','140px');
			                $('#sendBackResetPWDEmailButton').html((time/1000)%60+'秒后可重新发送');
			                if(time==0){
			                        clearInterval(x);
			                        $('#sendBackResetPWDEmailButton').css('width','118px');
			                        $('#sendBackResetPWDEmailButton').html('点击发送');
			                        $('#sendBackResetPWDEmailButton').removeAttr('disabled');
			                }
			        }, 1000);
			    }, 1000);
			    
				$.post('sendBackResetPwdEmail.do',{userName:userName,resetIsAdmin:resetIsAdmin},function(data){
					if(data.sucess==0){
						$('#tipContent').html(data.message);
	                	$("#asdf").trigger('click');
					}
				});
			}
			
			$(function (){
	            $("#backResetPwdForm").submit(function(){     // 提交表单的id
	            	var options ={
		        			dataType: 'json',
		        			success: function(data){
		        				if(data.sucess==0){
		        					$('#backResetPwdEmail').html('');
		        					$('#resetPwd').html('');
		        					$('#resetruePwd').html('');
		    	                	$('#tipContent').html(data.message);
		    	                	$("#asdf").trigger('click');
		    	                }else if(data.sucess==1){
		    	                	$('#backResetPwdEmail').html('');
		        					$('#resetPwd').html('');
		        					$('#resetruePwd').html('');
		        					$('#backResetPwdCloseButton').trigger('click');
		    	                }
		        			}
		        	};
	                $('#backResetPwdForm').ajaxSubmit(options); 
	                return false;   //防止表单自动提交
	            });
	        });
			
		</script>
		
		<script type="text/javascript">
			 $(function (){
		            $("#loginForm").submit(function(){     // 提交表单的id
		            	var options ={
			        			dataType: 'json',
			        			success: function(data){
			        				if(data.sucess==0){
			    	                	$('#tipContent').html(data.message);
			    	                	$("#asdf").trigger('click');
			    	                }else if(data.sucess==1){
			    	                	window.location.href='index';
			    	                }
			        			}
			        	};
		                $('#loginForm').ajaxSubmit(options); 
		                return false;   //防止表单自动提交
		            });
		        });
		</script>
		<script type="text/javascript">
			// 验证码的js
			getvCode();
	
			/**
			 * 获取验证码
			 * 将验证码写到login.html页面的id = verifyimg 的地方
			 */
			function getvCode() {
			    document.getElementById("verifyimg").src = timestamp("logVerifyCode.do");
			}
			//为url添加时间戳
			function timestamp(url) {
				var getTimestamp = new Date().getTime();
				if (url.indexOf("?") > -1) {
					url = url + "&timestamp=" + getTimestamp
				} else {
					url = url + "?timestamp=" + getTimestamp
			    }
			    return url;
			};
		</script>
		<!-- Classie -->
		<script src="js/classie.js"></script>
		<!--scrolling js-->
		<script src="js/jquery.nicescroll.js"></script>
		<script src="js/scripts.js"></script>
		<!--//scrolling js-->
		<!-- Bootstrap Core JavaScript -->
		<script src="js/bootstrap.js">
		</script>
	</body>

</html>